﻿function eventShowCk() {
    jzcode.event.sendEvent('eventShowCk', null);
}
function eventShowDc() {
    jzcode.event.sendEvent('eventShowDc', null);
}
function eventShowMt() {
    jzcode.event.sendEvent('eventShowMt', null);
}
function eventShowNone() {
    jzcode.event.sendEvent('eventShowNone', null);
}

function register() {
    jzcode.event.registerEvent('eventShowCk', function () {
        focusCk();
        g_seriesCk.data = g_s3MapCkData.mapData;
        g_seriesMt.data = [];
        g_seriesDc.data = [];
        option.graphic = {
            elements: [{
                id: 'layer-map-legend',
                type: 'image',
                left: 140,
                top: 910,
                style: {
                    image: './images/s3-1/s3-1-map-legend.png'
                },
                z: 3
            }, {
                id: 'count-ck',
                type: 'image',
                left: 529,
                top: 236,
                style: {
                    image: './images/s3-1/s3-1-count-ck.png'
                },
                z: 3
            }, {
                id: 'count-dc',
                $action:'remove'
            }, {
                id: 'count-mt',
                $action: 'remove'
            }, {
                id: 'count-org',
                $action: 'remove'
            }]
        };
        option.series[0].label = {
            normal: {
                show: true,
                textStyle: {
                    color: '#555577',
                    fontSize: 20
                },
                formatter: function (value, index) {
                    return value.name;
                }
            },
            emphasis: {
                show: true
            }
        };
        myChart.setOption(option);
        showLoopTable4Ck();
    });
    jzcode.event.registerEvent('eventShowDc', function () {
        focusDc();
        g_seriesCk.data = [];
        g_seriesMt.data = [];
        g_seriesDc.data = g_s3MapDcData.mapData;
        option.graphic = {
            elements: [{
                id: 'layer-map-legend',
                type: 'image',
                left: 140,
                top: 910,
                style: {
                    image: './images/s3-1/s3-1-map-legend.png'
                },
                z: 3
            }, {
                id: 'count-ck',
                $action: 'remove'
            }, {
                id: 'count-dc',
                type: 'image',
                left: 529,
                top: 236,
                style: {
                    image: './images/s3-1/s3-1-count-dc.png'
                },
                z: 3
            }, {
                id: 'count-mt',
                $action: 'remove'
            }, {
                id: 'count-org',
                $action: 'remove'
            }]
        };
        option.series[0].label = {
            normal: {
                show: true,
                textStyle: {
                    color: '#555577',
                    fontSize: 20
                },
                formatter: function (value, index) {
                    return value.name;
                }
            },
            emphasis: {
                show: true
            }
        };
        myChart.setOption(option);
        showLoopTable4Dc();
    });
    jzcode.event.registerEvent('eventShowMt', function () {
        focusMt();
        g_seriesCk.data = [];
        g_seriesDc.data = [];
        g_seriesMt.data = g_s3MapMtData.mapData;
        option.graphic = {
            elements: [{
                id: 'layer-map-legend',
                type: 'image',
                left: 140,
                top: 910,
                style: {
                    image: './images/s3-1/s3-1-map-legend.png'
                },
                z: 3
            }, {
                id: 'count-ck',
                $action: 'remove'
            }, {
                id: 'count-dc',
                $action: 'remove'
            }, {
                id: 'count-mt',
                type: 'image',
                left: 529,
                top: 236,
                style: {
                    image: './images/s3-1/s3-1-count-mt.png'
                },
                z: 3
            }, {
                id: 'count-org',
                $action: 'remove'
            }]
        };
        option.series[0].label = {
            normal: {
                show: true,
                textStyle: {
                    color: '#555577',
                    fontSize: 20
                },
                formatter: function (value, index) {
                    return value.name;
                }
            },
            emphasis: {
                show: true
            }
        };
        myChart.setOption(option);
        showLoopTable4Mt();
    });
    jzcode.event.registerEvent('eventShowNone', function () {
        focusNone();
        g_seriesCk.data = g_s3MapCkData.mapData;
        g_seriesDc.data = g_s3MapDcData.mapData;
        g_seriesMt.data = g_s3MapMtData.mapData;
        option.graphic = {
            elements: [{
                id: 'layer-map-legend',
                type: 'image',
                left: 140,
                top: 910,
                style: {
                    image: './images/s3-1/s3-1-map-legend.png'
                },
                z: 3
            }, {
                id: 'count-ck',
                $action: 'remove'
            }, {
                id: 'count-dc',
                $action: 'remove'
            }, {
                id: 'count-mt',
                $action: 'remove'
            }, {
                id: 'count-org',
                $action: 'remove'
            }]
        };
        option.series[0].label = {
            normal: {
                show: true,
                textStyle: {
                    color: '#555577',
                    fontSize: 20
                },
                formatter: function (value, index) {
                    return value.name;
                }
            },
            emphasis: {
                show: true
            }
        };
        option.series[0].data = null;
        myChart.setOption(option);
        myChart.setOption(option);
        hideLoopTable();
    });
}